package com.realtyManage.springboot.Dao;


import com.realtyManage.springboot.Model.Do.Commodity;
import com.realtyManage.springboot.Model.Do.ReceptionFabulous;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;

/**
 * 置业顾问点赞表
 *
 * @author 杭州素色网络科技有限公司
 * @since 2020-01-02
 */

@Repository
public interface ReceptionFabulousRepository extends JpaRepository<ReceptionFabulous, Long>, JpaSpecificationExecutor<ReceptionFabulous> {

    @Query(value = "select count(1) from reception_fabulous where  customer_id = ?1 and reception_id = ?2",nativeQuery = true)
    int findNumByIds(Integer cid,Integer rid);

    @Query(value = "select count(1) from reception_fabulous where reception_id = ?1",nativeQuery = true)
    int getFabulousNum(String rid);

    @Query(value = "select count(1) from reception_fabulous where  customer_id = ?1",nativeQuery = true)
    int getFabulousType(Integer cid);

    @Query(value = "select count(1) from reception_fabulous where  customer_id = ?1 and reception_id = ?2",nativeQuery = true)
    int getFabulousTypes(Integer cid,String rid);

}
